package top.dingwen.io.treasure.api.dict;

import org.springframework.stereotype.Component;
import top.dingwen.io.treasure.api.base.constant.ApiConstant;

/**
 * 字典翻译默认实现
 *
 * @author dingwen
 * @since 2024/8/31 22:42
 */
@SuppressWarnings(ApiConstant.ALL)
@Component
public class DictDefaultConvertor implements IDictConvertor {
    @Override
    public String convert(String dictCode, String dictValue, String defaultVal) {
        return defaultVal;
    }

    @Override
    public String convert(String dictCode, String dictValue) {
        return convert(dictCode, dictValue, ApiConstant.EMPTY);
    }

    @Override
    public String convertRevert(String dictCode, String dictLabel, String defaultVal) {
        return defaultVal;
    }

    @Override
    public String convertRevert(String dictCode, String dictLabel) {
        return convert(dictCode, dictLabel, ApiConstant.EMPTY);
    }
}
